// /**获取年月日  
//  给你一天时间 获取未来7天的时间
import moment from 'moment';
export function getWeek() {
    var time = new Date()
    var timesStamp = time.getTime()
    var weekDates = []
    for (var i = 0; i < 7; i++) {
      weekDates.push(
        new Date(timesStamp + 24 * 60 * 60 * 1000 * i)
          .toLocaleDateString()
          .replace(/\//g, '-')
      )
    }
    const list = []
    weekDates.forEach((e) => {
      e = e
        .split('-')
        .map((item) => {
          if (+item < 10) {
            return '0' + +item
          }
          return item
        })
        .join('-') // 最后重组回来
      list.push({
        data: e,
        week: moment(e).format('dddd'),
        day: e.slice(-2),
      })
    })
    return list;
  }